#define _USE_MATH_DEFINES
#include <math.h>
#include "gtest/gtest.h"
#include "main.h"
#include "integrate.h"


TEST(integrate,func) {
	EXPECT_NEAR(0.0, func(M_PI/2),0.00001);
}

TEST(integrate, read_from_file){
	double* tmp = read_from_file();
	EXPECT_EQ(1,tmp[0]);
	EXPECT_EQ(2,tmp[1]);
	EXPECT_EQ(3,tmp[2]);
	free(tmp);
}




int main(int argc, char **argv) {
    ::testing::InitGoogleTest(&argc, argv);
    return RUN_ALL_TESTS();
}
